﻿using System;
using System.Linq;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace PocketPasswordGen
{
    public partial class frmMain : Form
    {
        public frmMain()
        {
            InitializeComponent();
        }

        private void menuItemGenerate_Click(object sender, EventArgs e)
        {
            Password.PasswordLength   = (int) numericUpDownPasswordLength.Value;
            Password.ShowPhonetics    = checkBoxShowPhonetics.Checked;
            Password.IncludeLowerCase = checkBoxIncludeLowerCase.Checked;
            Password.IncludeUpperCase = checkBoxIncludeUpperCase.Checked;
            Password.IncludeNubmers   = checkBoxIncludeNumbers.Checked;
            Password.IncludePuncation = checkBoxIncludePunctuation.Checked;

            string password = Password.Generate();

            textBoxPassword.Text = password;
            textBoxPassword.Focus();
            textBoxPassword.SelectAll();

            textBoxPhoneticPassword.Text = Password.ConvertToPhonetic(password);
        }

        private void menuItemAbout_Click(object sender, EventArgs e)
        {
            frmAbout aboutForm = new frmAbout();
            aboutForm.ShowDialog();
        }

        private void menuItemCopy_Click(object sender, EventArgs e)
        {
            Clipboard.Copy(textBoxPassword);
        }
    }
}